package com.huangkailong.designpattern.proxy.common;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.UUID;

/**
 * @author huangkl
 * @since 1.0.0
 */
public class OrderServiceTest {
    /**
     * 测试 OrderService
     *
     * @param orderService {@link OrderService}
     */
    public static void testProxy(OrderService orderService) {
        Order order1 = Order.builder()
            .id(UUID.randomUUID().toString().replaceAll("-", ""))
            .info("测试订单1")
            .createdTime(LocalDateTime.now())
            .updatedTime(LocalDateTime.now())
            .build();
        orderService.createOrder(order1);

        LocalDateTime time = LocalDateTime.of(LocalDate.of(2020, 1, 1), LocalTime.now());
        Order order2 = Order.builder()
            .id(UUID.randomUUID().toString().replaceAll("-", ""))
            .info("测试订单1")
            .createdTime(time)
            .updatedTime(time)
            .build();
        orderService.createOrder(order2);
    }
}
